home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1680 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: sdd.hp.com!inn
  2. From: Jeff Grimmett <jgrimm@sdd.hp.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Must I free my linked lists? (GCC)
  5. Date: 22 Jan 1996 18:16:34 GMT
  6. Organization: Hewlett-Packard Company
  7. Message-ID: <4e0ka2$2tu@news.sdd.hp.com>
  8. References: <4dudic$aif@vixen.cso.uiuc.edu>
  9. NNTP-Posting-Host: hpsdv330.sdd.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  14.  
  15. Dannyman@uiuc.edu (Unknown) wrote:
  16.  
  17. >   "When my program exits, is the dynamic memory in the queues returned to
  18. >the system or is a "memory hole" left, so that I should actually go back and
  19. >return all the memory in my program ..."
  20.  
  21. If I understand you correctly, you want to know if you have to deallocate 
  22. the nodes in a linked list after creating it/them?  My answer is yes, if 
  23. so.  If you allocate it (AllocMem, malloc, whatever), you have to free 
  24. it, or it will be left, as you say, as a hole in the system memory.
  25.  
  26. The RKM includes some code examples for allocating and deallocating 
  27. linked lists.
  28.  
  29.  
  30.